<!DOCTYPE html>

<html>
    <head>
        <meta charset="UTF-8">
        <title>合并单元格</title>
    </head>

    <body>
        <h3 align="center">水平方向在同一行内合并单元格</h3>
        <table border="1" width="50%" align="center">
            <tr>
                <th>学号</th>
                <th>姓名</th>
                <th colspan="3">成绩</th>
            </tr>
            <tr>
                <td></td>
                <td></td>
                <td>数学</td>
                <td>语文</td>
                <td>Java</td>
            </tr>
            <tr>
                <td>1001</td>
                <td>李某芳</td>
                <td>89</td>
                <td>90</td>
                <td>61</td>
            </tr>
        </table>

        <h3 align="center">垂直在不同行内合并单元格</h3>

        <table border="1" width="50%" align="center">
            <thead>
                <tr>
                    <th rowspan="2">学号</th>
                    <th rowspan="2">姓名</th>
                    <th colspan="3">成绩</th>
                </tr>
                <tr>
                    <th>数学</th>
                    <th>语文</th>
                    <th>Java</th>
                </tr>
            </thead>
            <tbody>
                <tr>
                    <td>1001</td>
                    <td>李某芳</td>
                    <td>89</td>
                    <td>90</td>
                    <td>61</td>
                </tr>
                <tr>
                    <td>2002</td>
                    <td>李某婷</td>
                    <td>89</td>
                    <td>90</td>
                    <td>61</td>
                </tr>
            </tbody>
        </table>
    </body>
</html>